Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of Amazon ECS job, copied code from luigi.contrib.ecs.py and… #13

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

rhaarm
Copy link

@rhaarm rhaarm commented May 4, 2017

… modified for ndscheduler JobBase.

rhaarm added 4 commits May 4, 2017 11:26
… modified for ndscheduler JobBase.

Fixed the 100 character limit
… modified for ndscheduler JobBase.

Fixed the 100 character limit
blank whitespace
@@ -0,0 +1,122 @@
"""A sample job that prints string."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this comment.

Copy link
Contributor

@wenbinf wenbinf May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do people pass AWS credential? Better add some operational guidelines here, e.g., create dot file on worker nodes for aws credential .

import boto3

client = boto3.client('ecs')
except ImportError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, don't catch error here. Let the error bubble up. If boto is not imported, let it fail hard.


# Error checking
if response['failures']:
raise Exception('There were some failures:\n{0}'.format(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't raise a generic exception. Make a custom exception that subclasses Exception, e.g., ECSJobException.

@rhaarm
Copy link
Author

rhaarm commented May 4, 2017

Thanks, I'll update. I agree about the Exceptions and boto3 try/catch. Like I said before in the original comment this was copied from luigi.contrib.ecs, so there is definitely some mods that are needed.

Copy link
Contributor

@wenbinf wenbinf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this job. I can see that this job would be useful for Ops !

Before commit your code, better running make flake8 to for python code styling.

@rhaarm
Copy link
Author

rhaarm commented May 4, 2017

Yeah I'm using PyCharm so some of that is built-in, it's length limit is set to 160 characters. It looks like there are some other issues with 2 other files that I didn't edit.

Copy link
Contributor

@wenbinf wenbinf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Change the file comment for simple_scheduler/jobs/ecs_job.py and fix the "make flake8" error, then I'll approve it :)

No sure why there are "make flake8" errors from other files you didn't touch. But they are pretty easy to fix (e.g., adding one new blank line).

@wenbinf
Copy link
Contributor

wenbinf commented May 16, 2017

@rhaarm could you pull and merge from latest master? That should fix all the flake8 error & fixed unit tests for python 3.5. Then this pull request should be good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants